<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
    <script type="text/ecmascript" src="js/base64.js"></script>
    <script type="text/javascript" src="js/layui/layui.all.js"></script>
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/favicon.ico"/>
    <link rel="bookmark" href="${pageContext.request.contextPath}/favicon.ico"/>
<title>移动办公系统_用户登录</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-image: url(images/login_01.gif);
	overflow:hidden;
}
.STYLE3 {font-size: 12px; color: #FFFFFF; }
.STYLE4 {
	color: #FFFFFF;
	font-family: "方正大黑简体";
	font-size: 50px;
}
-->
</style>
<script>
function dosubmit(){
    // base 加密 用户名和密码(转码)
    var bas = new Base64();
    var name = $("#user_name").val();
    var pwd = $("#password").val();

    //加密
    username = bas.encode(name);
    password = bas.encode(pwd);
    $("#user_name").val(username);
    $("#password").val(password);
    //解密
  //  var str = bas.decode(hash);
    if (name==null || name=="" || pwd=="" || pwd==null) {
      layer.alert("用户名和密码不能为空！");
    return false;
    }
   $("#form1").submit();
}
</script>
</head>

<body>
<audio autoplay="autopaly">
        <source src="G.E.M. 邓紫棋 - 喜欢你.mp3" type="audio/mp3" />
</audio>
<form id="form1" action="login" method="post" >
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td background="images/login_03.gif">&nbsp;</td>
        <td width="876"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="299" valign="top" background="images/login_01.jpg">&nbsp;</td>
          </tr>
          <tr>
            <td height="54"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="394" height="69" background="images/login_02.jpg">&nbsp;</td>
                <td width="199" background="images/login_03.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="22%" height="22"><div align="center"><span class="STYLE3">用户名</span></div></td>
                    <td width="51%" height="22"><input name="user_name" id="user_name" type="text" size="12" style="height:20px;background-color:#032e49; color:#88b5d1; border:solid 1px #88b5d1;" /></td>
                    <td width="27%" height="22">&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="22" valign="middle"><div align="center"><span class="STYLE3">密&nbsp; 码</span></div></td>
                    <td height="22" valign="bottom"><input name="password" id="password" type="password" size="12" style="height:20px;background-color:#032e49; color:#88b5d1; border:solid 1px #88b5d1;" /></td>
                    <td height="22" valign="bottom">&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="22" valign="middle" class="STYLE3"><div align="center">验证码</div></td>
                    <td height="22" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="36%" height="22">
                            <input name="checkcode" type="text" size="5" style="height:20px;background-color:#032e49; color:#88b5d1; border:solid 1px #88b5d1;" /></td>
                          <!-- onclick="changeCode()" -->
                        <td width="64%">
                            <img id="checkcode" src="valicode" onclick="this.src=this.src+'?'" width="45" height="18">
                        </td>
                      </tr>
                    </table></td>
                    <td height="22" valign="middle"><img src="images/dl.gif" width="39" onClick="dosubmit();" height="17" /></td>
                  </tr>
                </table></td>
                <td width="283" background="images/login_04.jpg">&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="225" background="images/login_05.jpg">&nbsp;</td>
          </tr>
        </table></td>
        <td background="images/login_03.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
    <input type="hidden" id="msg" value="${msg}">
</body>

    <script type="text/javascript">
        if (top.location !== self.location) {
            top.location=self.location;	    }
    </script>


    <script>
       var msg =  $("#msg").val();
       if(msg!=null && msg.trim().length>0){
            layer.alert(msg);
       }
    </script>

<!--加载图片验证码 -->
<script type="text/javascript">
  /**
   * 点击获取随机生成的验证码
   */
  function changeCode() {
    $("#checkcode").attr('src', 'valicode?' + Math.floor(Math.random() * 100));
  }

  /*$(function(){
    $.ajax({
      url: "@{/code}",
      type: "GET",
      async : true,	//异步请求
      data: {},
      dataType:"text",
      success: function (data) {
        $("#checkcode").attr("src","data:image/jpg;base64,"+data)
      }, error: function () {
        alert("没有获取返回数据");
      }
    });
  });
*/
</script>

</html>
